//
//  MeCell.swift
//  iPhone
//
//  Created by Toj on 5/15/23.
//

import UIKit

class VCCell: UITableViewCell {
    
    var cellModel: VCCellModel? { didSet{
        guard let model = cellModel else { return }
        classNameLabel.text = model.name
        descriptionLabel.text = model.des
    } }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        selectionStyle = .none
        contentView.backgroundColor = .white
        
        contentView.addSubview(classNameLabel)
        contentView.addSubview(descriptionLabel)
        
        classNameLabel.snp.makeConstraints { make in
            make.left.equalTo(self).inset(15)
            make.top.right.equalTo(self).inset(5)
        }
        descriptionLabel.snp.makeConstraints { make in
            make.left.equalTo(contentView).inset(25)
            make.bottom.right.equalTo(contentView).inset(5)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private lazy var classNameLabel: UILabel = {
       let view = UILabel()
        view.textColor = "#CC9900".to_color
        view.font = 14.to_boldFont
        return view
    }()
    
    private lazy var descriptionLabel: UILabel = {
       let view = UILabel()
        view.textColor = "#666666".to_color
        view.font = 12.to_boldFont
        return view
    }()
}
